<template>
	<div class="twoStageWindow">
		<div class="twoStageWindowTitle">
      <span>
        编辑仪器
      </span>
       <span style="font-size:13px;margin-left:8px;"> {{editData.name}}</span>
      <!-- tab切换按钮 -->
  		<div class="twoStageWindowClose"  >
  			<!--<el-button size="mini" type="primary" @click="add" >修改仪器</el-button>-->
  			<el-button size="mini" @click="close">取消</el-button>
  		</div>
  	</div>
  	<div class="containercontent" style="height:99%;padding:10px;" size="mini">
		<el-tabs type="card"  style="height: 100%;overflow-y:auto;" class="equipTab typeOfCard">
		  <el-tab-pane label="基础信息"><edit-basic :editData="editData" ref="editBasicRef"></edit-basic></el-tab-pane>
		  <el-tab-pane label="仪器维护计划">  <maintain :maintainData="editData"></maintain></el-tab-pane>
		  <el-tab-pane label="测试前检查"><before-check :beforeCheckData="editData"></before-check></el-tab-pane>
		  <el-tab-pane label="测试后检查"><use-check :useCheckData="editData"></use-check></el-tab-pane>
		  <el-tab-pane label="仪器接口"><port :portData="editData" ref="portAddRef"></port></el-tab-pane>
		  <el-tab-pane label="仪器文档"><documents :editData="editData" flag="edit"></documents></el-tab-pane>
		</el-tabs>
  	</div>
	</div>
</template>

<script>
	import editBasic from './editDialogPage/editBasic' //基础信息
	import maintain from './editDialogPage/maintain' //仪器维护
	import port from './editDialogPage/Port' //仪器接口
	import documents from './editDialogPage/Document' //仪器文档
	import useRecord from './editDialogPage/useRecord' //使用记录
	import calibrationCurve from './editDialogPage/calibrationCurve' //校准曲线
	import useCheck from './editDialogPage/useCheck' //仪器使用检查项
	import beforeCheck from './editDialogPage/beforeCheck' //使用前检查
	export default {
		components:{
			editBasic,
			maintain,
			port,
			documents,
			useRecord,
			calibrationCurve,
			useCheck,
			beforeCheck,
	  },
	  props:{
	  	editData:Object
	  },
		data(){
			return {
				nowTab:'',
				tableHeightD: ((window.innerHeight - 300) / 3 - 25),
			}
		},
		mounted(){
			this.nowTab = 'basic'
		},
		methods:{
			add(val){
				if(this.nowTab === 'basic'){
					this.$refs.editBasicRef.submit(val)
				}else if(this.nowTab === 'port'){
					this.$refs.portAddRef.submit()
				}
			},
			close(){
				this.$parent.editShow=false;
				this.$parent.init()
			},
			tabDivMinHeight(){
	      return (window.innerHeight - 560)
	    },
	    handleSizeChange(){},
	    handleCurrentChange(){},
	    tabDivHeight(){
	      return (window.innerHeight - 460)
	    },
		}
	}
</script>

<style scoped>
	.instrument-add{
		position: static;
	}
	.twoStageWindowTitle{
      position: static;
  }
	.tabName{
    display: inline-block;
    cursor: pointer;
    padding: 0px 15px;
    border: 1px solid #b7b7b7;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    color: #a9a9a9;
}
	.activeTab{
	  color: #409eff;
	}
	.infoitem {
    width: calc(100%/2);
    padding-right: 20px;
}
	.separaterow{
	  margin-top: 5px;
	}
	.informationItem {
	    width: calc(100% - 113px);
	    float: right;
	}
</style>
<style>
  .equipTab .el-tabs__header{
      margin: 0 0 5px !important;
  }
	.equipTab .el-tabs__content{
		height: calc(99% - 35px);
	}
	.equipTab .el-tabs__content .el-tab-pane{
		height: 100%;
	}
</style>
